﻿<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>列表的排序过渡</title>
</head>

<body>
    <script src="lodash.js"></script>
    <style>
        .flip-list-move {
            transition: transform 1s;
        }
    </style>
    <div id="app">
        <button v-on:click="shuffle">排序过滤</button>
        <transition-group name="flip-list" tag="ul">
            <li v-for="item in items" v-bind:key="item">
                {{ item }}
            </li>
        </transition-group>
    </div>

    <!--引入vue文件-->
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
    <script>
        const mv = Vue.createApp({
            data() {
                return {
                    items: [1, 2, 3, 4, 5, 6, 7, 8, 9],
                    nextNum: 10
                }
            },
            methods: {
                shuffle() {
                    this.items = _.shuffle(this.items);
                }
            }
        }).mount('#app');
    </script>
</body>

</html>